<?php

class ActionIndex extends BaseAction
{
    public function run()
    {
        $sDoRequest = Yii::app()->request->getParam('do');
        
        if ( $sDoRequest == 'delete' )
        {
            $this->renderPartial = true;
            $iContactId = Yii::app()->request->getParam('contact_id');
            $oContact   = Contact::model()->findByPk($iContactId);
            $oContact->delete();
        }
        
        $oCriteria        = new CDbCriteria();
        $oCriteria->order = 'contact_cdate DESC';
        
        $oDataProvider = new CActiveDataProvider('Contact', array
        (
            'criteria'   => $oCriteria,
            'pagination' => array
            (
                'pageSize' => 100
            )
        ));

        $this->template->oDataProvider = $oDataProvider;
    }
}